package com.defangit.production.domain;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 生产订单实体类
 */
public class ProductionBill {
    /**
     * no:编号；
     * item:产品与数量
     * process:工序订单
     * author:生产订单作者
     * liable:生产订单主管
     * */
    private int id;
    private String no;
    private ManufactureItem item;
    private List<ProductionProcess> processes=new ArrayList<>();
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private LocalDateTime expectEndTime;
    private Store store;
    private Operator author;
    private Operator liable;
    private LocalDateTime createTime = LocalDateTime.now();

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public ProductionBill setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
        return this;
    }

    public Operator getAuthor() {
        return author;
    }

    public ProductionBill setAuthor(Operator author) {
        this.author = author;
        return this;
    }

    public Store getStore() {
        return store;
    }

    public ProductionBill setStore(Store store) {
        this.store = store;
        return this;
    }

    public LocalDateTime getExpectEndTime() {
        return expectEndTime;
    }

    public ProductionBill setExpectEndTime(LocalDateTime expectEndTime) {
        this.expectEndTime = expectEndTime;
        return this;
    }

    public int getId() {
        return id;
    }

    public ProductionBill setId(int id) {
        this.id = id;
        return this;
    }

    /**
     * 生产订单编号
     * @return 生产订单编号
     */
    public String getNo() {
        return no;
    }

    public ProductionBill setNo(String no) {
        this.no = no;
        return this;
    }

    /**
     * 生产订单目标产品项
     * @return 生产订单目标产品项
     */
    public ManufactureItem getItem() {
        return item;
    }

    public ProductionBill setItem(ManufactureItem item) {
        this.item = item;
        return this;
    }

    /**
     * 生产订单涉及的工序派工单列表
     * @return 生产订单涉及的工序派工单列表
     */
    public List<ProductionProcess> getProcesses() {
        return processes;
    }

    public ProductionBill setProcesses(List<ProductionProcess> processes) {
        this.processes = processes;
        return this;
    }

    /**
     * 生产订单负责人
     * @return 生产订单负责人
     */
    public Operator getLiable() {
        return liable;
    }

    public ProductionBill setLiable(Operator liable) {
        this.liable = liable;
        return this;
    }

    /**
     * 生产订单开始时间
     * @return 生产订单开始时间
     */
    public LocalDateTime getStartTime() {
        return startTime;
    }

    public ProductionBill setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * 生产订单结束时间
     * @return 生产订单结束时间
     */
    public LocalDateTime getEndTime() {
        return endTime;
    }

    public ProductionBill setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
        return this;
    }
}
